//
//  ZZTopicCommentEntity.m
//  Qzone
//
//  Created by zhangxy on 2018/6/11.
//  Copyright © 2018年 zhang. All rights reserved.
//

#import "ZZTopicCommentEntity.h"

@implementation ZZTopicCommentEntity



- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        self = [ZZTopicCommentEntity yy_modelWithDictionary:dictionary];
        NSMutableArray *arr = dictionary[@"thread_list"];
        _thread_list = [[NSMutableArray alloc] init];
        for (NSDictionary *item in arr) {
            [_thread_list addObject:[[ZZTopicCommentEntity alloc] initWithDictionary:item]];
        }
        
        User *user_info = [[User alloc] initWithDictionary:dictionary[@"user_info"]];
        if(user_info!=nil && convertToString(_user_id).length == 0){
            _user_id = user_info.user_id;
            _user_name = user_info.user_name;
            _user_avatar = user_info.user_avatar;
        }
    }
    return self;
}


+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper
{
    return @{
             @"comment_id" : @"id",
//             @"user_id" : @"user_id",
//             @"user_name":@"user_name",
//             @"user_avatar":@"user_avatar",
             @"message":@"message",
             @"add_time":@"add_time"
             };
}

@end
